package com.twq.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Arrays;

//在templates下的页面只能通过controller
@Controller
public class IndexController {
   @RequestMapping("/test")
    public String index(Model model){
       model.addAttribute("msg","<h2>hello,springboot</h2>");

      model.addAttribute("users", Arrays.asList("twq","谭文强"));
       return "test";
    }

}
